#!/usr/bin/env python3
#个人账户信息
account = {"name":"liyang","num":"50000","passwd":"123456"}
#存取钱函数
def moneyManager(num,mode):
    global account
    cnt = int(account["num"])
    if mode == 0:
        cnt -= int(num)
    else:
        cnt += int(num)
    account["num"] = str(cnt)
    print("您的当前余额为:"+account["num"])
# #主菜单页面
def showMenu():
    password = input("请输入您的密码：")
    if password != "123456":
        print("密码错误！")
        return
    global account
    while True:
        print("="*20+"请选择需要的操作"+"="*20)
        print("{0:<1}{1:<10}{2:<15}".format(" ","1.查询余额","2.取款"))
        print("{0:<1}{1:<10}{2:<15}".format(" ","3.存款","4.修改密码"))
        print("{0:<1}{1:<10}{2:<15}".format(" ", "5.退出", ""))

        key = input("请输入对应的选择:")
        if key == "1":
            print("您的当前余额为:"+account["num"])
            input("按任意键继续...")
        elif key == "2":
            moneyManager(input("输入您要取的钱数"),0)
        elif key == "3":
            moneyManager(input("输入您要存的钱数"),1)
        elif key == "4":
            print("暂不支持该功能！")
        elif key == "5":
            return

#test
showMenu()





